package com.woniu.supermarket.mapper;

import com.woniu.supermarket.entity.SalesReturnDetail;
import com.woniu.supermarket.vo.SalesReturnDetailVo;
import com.woniu.supermarket.vo.totalWithId;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.List;

@Repository
public interface SalesReturnDetailMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(SalesReturnDetail record);

    SalesReturnDetail selectByPrimaryKey(Integer id);

    List<SalesReturnDetail> selectAll();

    int updateByPrimaryKey(SalesReturnDetail record);

    List<SalesReturnDetailVo> selectAllVo(Integer id);

    @Update("update s_sales_return_detail set total = #{total} where id = #{id}")
    void updateTotalByPrimaryKey(@Param("id") Integer id, @Param("total") BigDecimal total);

    void updateTotalBatch(List<totalWithId> totalWithIdList);

}